<!-- inc:frame.top -->

<!-- if($sysAct == "add" || $sysAct == "modify") -->
<!-- run:$button_msg = $sysAct == "modify" ? "编辑会员" : "添加会员" -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=user&act=list">会员管理</a> &raquo; <a href="{:$mainlink}?file=user&act=list">会员列表</a> &raquo; {:$button_msg}</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <form method="post" action="{:$mainlink}?file=user&act=viewok{if($id)}&id={:$id}{end}" enctype="multipart/form-data" onsubmit="return add_msg(this);">
  <div class="content_box">
    <div class="content_bor">
      <table class="ctable">
        <tr>
          <td class="left">账号：<span style="color:red;">*</span></td>
          <td class="right"><input class="ginput" type="text" name="username" id="username" value="{:$rs[user]}" /></td>
        </tr>
        <tr>
          <td class="left">会员职务：</td>
          <td class="right">
            <select name="levelid" id="levelid">
              <option value="0" style="color:red;">请选择一个会员职务</option>
              <!-- $job_cate AS $key=>$value -->
              <option value="{:$value[id]}" {if($value[id] == $rs[levelid])} selected{end}>{:$value[name]}</option>
              <!-- end -->

<
            </select>
            &nbsp;
            <!--<span>[若本产品为新品登陆才可以查看，请选择对应类别]</span>-->
          </td>
        </tr>
        <tr>
          <td class="left">密码：<span style="color:red;">*</span></td>
          <td class="right">
            <input class="ginput" type="text" name="password" id="password" value="{:$rs[pass]}" />
            &nbsp;
            <!-- if($sysAct == "modify") -->
            <span>[不修改密码请不要改动内容]</span>
            <!-- else -->
            <span>[请输入密码]</span>
            <!-- end -->
          </td>
        </tr>
        <tr>
          <td class="left">姓名：</td>
          <td class="right"><input class="ginput" type="text" name="realname" id="realname" value="{:$rs[realname]}" /></td>
        </tr>
        <tr>
          <td class="left">性别：</td>
          <td class="right">
            <select name="gender">
              <option value="0"{if($rs[gender] == 0)} selected{end}>不限</option>
              <option value="1"{if($rs[gender] == 1)} selected{end}>男性</option>
              <option value="2"{if($rs[gender] == 2)} selected{end}>女性</option>
            </select>
          </td>
        </tr>


        <tr>
          <td class="left">公司名称：</td>
          <td class="right"><input class="ginput" type="text" name="company" id="company" value="{:$rs[company]}" /></td>
        </tr>
          <tr>
              <td class="left">所属行业：</td>
              <td class="right">
                  <select name="hangye_id" id="hangye_id">
                      <option value="0" style="color:red;">请选择一个行业</option>
                      <!-- $hangye_cate AS $k=>$v -->
                      <option value="{:$v[id]}" {if($v[id] == $rs[hangye_id])} selected{end}>{:$v[name]}</option>
                      <!-- end -->


                  </select>

                  <!--<input class="ginput" type="text" name="company" id="company" value="{:$rs[company]}" />-->
              </td>
          </tr>

        <tr>
          <td class="left">在公司担任职务：</td>
          <td class="right"><input class="ginput" type="text" name="company_title" id="company_title" value="{:$rs[company_title]}" /></td>
        </tr>


        <tr>
          <td class="left">邮箱：</td>
          <td class="right"><input class="ginput" type="text" name="email" id="email" value="{:$rs[email]}" /></td>
        </tr>
        <tr>
          <td class="left">手机：</td>
          <td class="right"><input class="ginput" type="text" name="phone" id="phone" value="{:$rs[phone]}" /></td>
        </tr>
        <tr>
          <td class="left">公司联系地址：</td>
          <td class="right"><input class="ginput" type="text" name="address" id="address" value="{:$rs[address]}" /></td>
        </tr>
        <!-- 加载内容编辑器信息 -->
        <input type="hidden" id="sysid" value="{:$sysgroupid}" />
        <script>
            var sysid = document.getElementById("sysid").value;
        </script>

        <tr>
          <td class="left">公司简介：</td>
          <td class="right">
                  <!-- inc:editorue.qg -->
            </td>
          <!--<td class="right"><input class="ginput" type="text" name="company_intro" id="company_intro" value="{:$rs[company_intro]}" /></td>-->

        </tr>

          <tr>
              <td class="left">图片：</td>
              <td class="right">
                  <div id="rsdpic"><img id="rsdimg" src="{:$rsd[folder]}{:$rsd[thumbfile]}" style="{if($rsd[thumbfile])}height:100px;{else}height:0;{end} cursor:pointer" onclick="preview_thumb();" /></div>
                  <span><button class="gbutton gbutton_min" type="button" onclick="qg_openthumb();">产品图</button></span>
                  <span id="del_thumb" style="display:none;">
            <button class="gbutton gbutton_min" type="button" onclick="preview_thumb();">预览</button>
            <button class="gbutton gbutton_min" type="button" onclick="delete_thumb();">删除</button>
            </span>
                  <input type="hidden" name="thumb" id="thumb" value="{:$rs[thumb]}" />
                  &nbsp;
                  <span>[仅支持一张产品图]</span>
              </td>
          </tr>


          <script type="text/javascript">

                  function qg_openthumb(id)
                  {
                      if(!id){id="";}
                      var values = document.getElementById("thumb"+id).value;
                      var url = "{:$mainlink}?file=open.addthumb"+id+"&act=add&values=" + values + "&sysgroupid={:$sysgroupid}";
                      qg_open(url,"540");
                  }
              function preview_thumb(id)
              {
                  if(!id){id="";}
                  var values = document.getElementById("thumb"+id).value;
                  var url = "{:$mainlink}?file=open.viewpic&id=" + values + "&type=thumb";
                  qg_open(url,"540");
              }
              function delete_thumb(id)
              {
                  if(!id){id="";}
                  document.getElementById("thumb"+id).value = "";
                  document.getElementById("del_thumb"+id).style.display = "none";
                  document.getElementById("rsdimg"+id).src = "";
                  document.getElementById("rsdimg"+id).style.height = "0";
              }

              function chk_thumb()
              {
                  var values = document.getElementById("thumb").value;
                  if(values && values != "0")
                  {
                      document.getElementById("del_thumb").style.display = "";
                  }

              }
              chk_thumb();
          </script>

          <!--<tr>
              <td class="left">公司展示图片：</td>
              <td class="right"><input class="ginput" type="file" name="filename" id="filename"  /></td>
          </tr>-->


      </table>
    </div>
  </div><!--content_box-->
  
  <div class="gbutton_div"><button type="submit" class="gbutton gbutton_dblue gbutton_add" id="creat_button">{:$button_msg}</button> &nbsp; <button type="button" class="gbutton gbutton_add" onclick="qgurl('{:$mainlink}?file=user&act=list')">返回</button> &nbsp; <span id="show_step" style="color:red;"><img src="images/loading.gif" style="visibility:hidden;" /></span></div>
  </form>
</div><!--page_pad-->

<script type="text/javascript">
function add_msg(o)
{

    document.getElementById("content").value=UE.getEditor('myEditor').getContent();


	if(!o.username.value)
	{
		tip_msg('账号不允许为空');
		return false;
	}
	if(!o.password.value)
	{
		tip_msg('密码不允许为空');
		return false;
	}
	document.getElementById("show_step").innerHTML = "<img src='images/loading.gif' border='0' align='absmiddle'> 正在保存数据，如果网页没有动静请刷新...";
	document.getElementById("creat_button").disabled=true;
}
</script>

<!-- elseif($sysAct == "list") -->
<div class="position"><p><!-- inc:position --> &raquo; <a href="{:$mainlink}?file=user&act=list">会员管理</a> &raquo; 会员列表</p><!-- inc:position.fr --></div>

<div class="page_pad">
  <div class="content_add"><button class="gbutton gbutton_dblue gbutton_add" type="button" onclick="qgurl('{:$mainlink}?file=user&act=add')">添加会员</button></div>
  
  <div class="content_ctrl">
    <form method="post" action="{:$mainlink}?file=user&act=list">
      <table class="ftable">
        <tr>
          <td><input class="ginput ginput_minhei" type="text" name="keywords" id="keywords" value="{:$keywords}" placeholder="搜索" /></td>
          <td>
            <select name="stype" id="stype">
              <!--<option value="user"{if($stype == "user")} selected{end}>会员</option>-->
              <!--<option value="realname"{if($stype == "realname")} selected{end}>真实姓名</option>-->
              <!--<option value="email"{if($stype == "email")} selected{end}>邮箱</option>-->

              <option value="company"{if($stype == "company")} selected{end}>公司</option>
                <option value="phone"{if($stype == "phone")} selected{end}>联系电话</option>
              <!--<option value="address"{if($stype == "address")} selected{end}>联系地址</option>-->
            </select>
          </td>
          <td><button class="gbutton" type="submit">搜索</button></td>
        </tr>
      </table>
    </form>
  </div>
  
  <div class="content_box">
    <div class="content_bor">
      <table class="ltable">
        <tr>
          <td width="100">会员ID</td>
          <!--<td width="100">会员账号</td>-->
            <td width="100">协会职务</td>
          <td>公司名称</td>

          <td>联系人</td>
          <td>联系电话</td>
          <td width="330">操作</td>
        </tr>
        <!-- $rslist AS $key=>$value -->
        <tr>
        <td>{:$value[id]}</td>
        <!--<td>{:$value[user]} </td>-->
        <td>{:get_association_title1($value[levelid])} </td>

        <td>{:$value[company]}</td>
        <td>{:$value[realname]}</td>
        <td>{:$value[phone]}</td>
        <td>
          <button class="gbutton" type="button" onclick="qg_modify({:$value[id]})">编辑</button>
          <button class="gbutton" type="button" onclick="qg_delete({:$value[id]})">删除</button>
          <button class="gbutton" type="button" onclick="qg_state({:$value[id]},{if($value[state]==1)}0{else}1{end})"><!-- if($value[state]==1) -->已审核<!-- else -->未审核<!-- end --></button>
          </td>
        </tr>
        <!-- end -->
      </table>
    </div>
  </div><!--content_box-->
  
  <!-- if($pagelist) --><div class="content_ctrl" align="right">{:$pagelist}</div><!-- end -->
</div><!--page_pad-->

<script type="text/javascript">
function qg_modify(id)
{
	window.location.href="{:$mainlink}?file=user&act=modify&id="+id;
}
function qg_state(id,stateid)
{
	window.location.href="{:$mainlink}?file=user&act=state&id="+id+"&state="+stateid;
}
function qg_delete(id)
{
	//判断是否删除
	url = "{:$mainlink}?file=user&act=delete&id="+id;
	tip_confirm("确认删除该信息吗？特别说明，删除后无法恢复！",url);
}
</script>
<!-- end -->

<!-- inc:frame.bottom -->